package main

import (
	"cid-media-api/batch"
	"cid-media-api/config"
	"cid-media-api/router"
	"github.com/gin-gonic/gin"
	"log"
)

func main() {
	config.InitConfig()

	//ocean.SetUp()
	batch.Batch()

	// cron job workers on/off
	if config.AppConfig.CronJob.On {
		log.Println("定时脚本配置开启, 读取配置中......")
		//workers.SetupWorkers()
		log.Println("定时脚本配置完成")
	}

	r := gin.Default()
	r = router.SetupTestRouter(r)

	r.Run(":" + config.AppConfig.App.Port)
}
